{% load i18n %}

{% if albums %}
<ul class="albums">
  {% for album in albums %}
  <li class="album">
    <a href="/album/{{ album.key.id }}" class="cover">
      {% if album.cover %}
      <img src="/picture/{{ album.cover.key.id }}_t.jpg" alt="{{ album.name }}" />
      {% else %}
      <img src="/static/cover.jpg" alt="default cover" />
      {% endif %}
    </a>
    <div class="desc">
      <a href="/album/{{ album.key.id }}" class="name">{{ album.name }}</a>
      <div>{{ album.creator.nickname }}</div>
      <div>{{ album.created_date|date:"Y.m.d" }}</div>
      <div>{{ album.pictures.count }} {% trans "pictures" %}</div>
    </div>
  </li>
  {% endfor %}
</ul>
{% if next_page or previous_page %}
<div class="pager_box">
  {% if previous_page %}<a href="/album?page={{ previous_page }}">{% trans "previous page" %}</a>{% endif %}
  {% if next_page and previous_page %}&bull;{% endif %}
  {% if next_page %}<a href="/album?page={{ next_page }}">{% trans "next page" %}</a>{% endif %}
</div>
{% endif %}

{% else %}
<p>{% trans "no album yet" %}</p>
<a href="/album/create">{% trans "create new one, perhaps?" %}</a>

{% endif %}
